#include <iostream>
#include <queue>
#include <vector>
#include <cstring>
using namespace std;

int n, m, qq;
const int N = 1e5 + 10;
int dis[2][N];
vector<int> vec[N];

int main()
{
    cin >> n >> m >> qq;
    for (int i = 1, u, v; i <= m; i++)
    {
        cin >> u >> v;
        vec[u].push_back(v);
        vec[v].push_back(u);
    }

    queue<pair<int, int> > q;
    memset(dis, 0x3f, sizeof dis);
    dis[0][1] = 0;
    q.push(make_pair(0, 1));

    while (q.size())
    {
        int k = q.front().first, x = q.front().second; q.pop();
        
        for (int i = 0; i < vec[x].size(); i++)
        {
            int y = vec[x][i];
            if (dis[!k][y] != 0x3f3f3f3f) continue;
            dis[!k][y] = dis[k][x] + 1;
            q.push(make_pair(!k, y));
        }
    }

    for (int i = 1, a, L; i <= qq; i++)
    {
        cin >> a >> L;
        if (dis[L & 1][a] == 0x3f3f3f3f || L < dis[L & 1][a]) puts("No");
        else puts("Yes");
    }
}